<script lang="ts" setup>
import { reactive } from 'vue'
const cascaderData = [
  {
    label: '选项1',
    value: '1',
    children: [
      {
        label: '选项1-1',
        value: '1-1'
      }
    ]
  },
  {
    label: '选项2',
    value: '2',
    children: [
      {
        label: '选项2-1',
        value: '2-1'
      },
      {
        label: '选项2-2',
        value: '2-2'
      },
      {
        label: '选项2-3',
        value: '2-3'
      }
    ]
  }
]
const formList = reactive<FormList>([
  {
    label: '级联搜索',
    prop: 'cascader3',
    type: 'cascader',
    filterable: true,
    filterMethod({ node, value, c, formData }) {
      console.log(node, value, c, formData)
      return true
    },
    data: cascaderData
  }
])
const submitForm = (formData: any) => {
  console.log(formData)
}
</script>
<template>
  <XyAddForm isCard :formList="formList" @submit-form="submitForm" />
</template>
